<?php if (!defined('THINK_PATH')) exit();?>

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="/style/admin/style.css" />
<link rel="stylesheet" type="text/css" href="/javascript/home/webuploader/webuploader.css" />
<link rel="stylesheet" type="text/css" href="/kindeditor/skins/tinymce.css" />
    <script type="text/javascript">
 	var VAR_MODULE = "<?php echo conf("VAR_MODULE");?>";
	var VAR_ACTION = "<?php echo conf("VAR_ACTION");?>";
	var MODULE_NAME	=	'<?php echo MODULE_NAME; ?>';
	var ACTION_NAME	=	'<?php echo ACTION_NAME; ?>';
	var ROOT = '__APP__';
	var ROOT_PATH = '<?php echo APP_ROOT; ?>';
	var CURRENT_URL = '<?php echo trim($_SERVER['REQUEST_URI']);?>';
	var INPUT_KEY_PLEASE = "<?php echo (L("INPUT_KEY_PLEASE")); ?>";
	var TMPL = '__TMPL__';
	var APP_ROOT = '<?php echo APP_ROOT; ?>';
</script>
<script type="text/javascript" src="/javascript/home/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="/javascript/admin/jquery.timer.js"></script>
<script type="text/javascript" src="/javascript/admin/script.js"></script>
<script type="text/javascript" src="/javascript/admin/lang.js"></script>
<script type="text/javascript" src="/javascript/home/webuploader/webuploader.min.js"></script>
<script type="text/javascript" src="/kindeditor/kindeditor.js"></script>
<script type="text/javascript" src="/javascript/admin/calendar/WdatePicker.js"></script>
<script type="text/javascript" src="/javascript/admin/common.js"></script>
</head>
<body>
<div id="info"></div>

<div class="main">
<div class="main_title"><?php echo (L("EDIT")); ?> <a href="<?php echo u("IndexImage/index");?>" class="back_list"><?php echo (L("BACK_LIST")); ?></a></div>
<div class="blank5"></div>
<form name="edit" action="__APP__" method="post" enctype="multipart/form-data">
<table class="form" cellpadding=0 cellspacing=0>
	<tr>
		<td colspan=2 class="topTd"></td>
	</tr>
	<tr>
		<td class="item_title">标题:</td>
		<td class="item_input"><input type="text" class="textbox require" name="title" value="<?php echo ($vo["title"]); ?>" /></td>
	</tr>
	<tr>
		<td class="item_title">链接:</td>
		<td class="item_input"><input type="text" class="textbox" name="url" value="<?php echo ($vo["url"]); ?>" /></td>
	</tr>
	<tr>
		<td class="item_title">图片:</td>
		<td class="item_input"><script type="text/javascript">
    $(document).ready(function() {
        var image_uploader = WebUploader.create({
            auto: true,
            chunked: false,
            method: 'POST',
            disableGlobalDnd: true,
            fileNumLimit: 1,
            swf: '/javascript/home/webuploader/Uploader.swf',
            server: '/admin.php?m=File&a=flash_upload',
            pick: '#image_filePicker',
            accept: {
                title: '选择图片',
                extensions: 'gif,jpg,jpeg,png',
                mimeTypes: 'image/*'
            }
        });
        image_uploader.on('uploadSuccess', function (file,response) {
            var data = JSON.parse(response._raw);
            if(typeof(data.error) != 'undefined'){
                alert('上传错误');
            }else{
                $('#img_image').attr('src',data.result + '?rand='+Math.random());
                $('#image').val(data.result);
            }
            image_uploader.reset();
        });
    });
</script>
<div style='width:120px; height:40px; margin-left:10px; display:inline-block;  float:left;' class='none_border'><a id='image_filePicker' class='ke-icon' style='width:160px' title='上传图片'><span class='ke-common-icon ke-icon-upload_image'></span></a><input type='hidden' id='image' name='image' value='<?php echo ($vo["image"]); ?>' /><div id='image_fileList' class='uploader-list'></div></div><img src='<?php echo ($vo["image"]); ?>' onclick="openimg('image')" style='display:inline-block; float:left; cursor:pointer; margin-left:10px; border:#ccc solid 1px; width:35px; height:35px;' id='img_image' /><img src='/images/admin/del.gif' style='display:inline-block; margin-left:10px; float:left; border:#ccc solid 1px; width:35px; height:35px; cursor:pointer;' id='img_del_image' onclick='delimg("image")' title='删除' /></td>
	</tr>
	
	<tr>
		<td class="item_title"><?php echo (L("SORT")); ?>:</td>
		<td class="item_input"><input type="text" class="textbox" name="sort" value="<?php echo ($vo["sort"]); ?>" /></td>
	</tr>

    <tr>
        <td class="item_title"><?php echo (L("IS_EFFECT")); ?>:</td>
        <td class="item_input">
            <lable><?php echo (L("IS_EFFECT_1")); ?><input type="radio" name="status" value="1" <?php if($vo['status'] == 1 ): ?>checked="checked"<?php endif; ?> /></lable>
            <lable><?php echo (L("IS_EFFECT_0")); ?><input type="radio" name="status" value="0" <?php if($vo['status'] == 0 ): ?>checked="checked"<?php endif; ?> /></lable>
        </td>
    </tr>
	
	<tr>
		<td class="item_title"></td>
		<td class="item_input">
			<!--隐藏元素-->
			<input type="hidden" name="<?php echo conf("VAR_MODULE");?>" value="IndexImage" />
			<input type="hidden" name="<?php echo conf("VAR_ACTION");?>" value="update" />
			<input type="hidden" name="id" value="<?php echo ($vo["id"]); ?>" />
			<!--隐藏元素-->
			<input type="submit" class="button" value="<?php echo (L("EDIT")); ?>" />
			<input type="reset" class="button" value="<?php echo (L("RESET")); ?>" />
		</td>
	</tr>
	<tr>
		<td colspan=2 class="bottomTd"></td>
	</tr>
</table>	 
</form>
</div>
</body>
</html>